const nodata = require('../tw-lib-base/no-data/props')
const commonProps = require('../tw-lib-base/chart/common-props')
const axisProps = require('../tw-lib-base/chart/axis-props')
const datazoomProps = require('../tw-lib-base/chart/datazoom-props')
const tooltipProps = require('../tw-lib-base/chart/tooltip-props')

module.exports = {
  ...commonProps,

  ...axisProps,
  ...datazoomProps,
  ...tooltipProps,

  barMaxWidth: {
    type: String,
    default: '50%',
    name: '柱子最大宽度',
    filedType: 'string'
  },
  showBarLabel: {
    type: Boolean,
    default: false,
    name: '显示柱子标签',
    filedType: 'switch'
  },
  barPosition: {
    type: String,
    default: 'top',
    name: '柱子标签位置',
    filedType: 'string'
  },
  barFontSize: {
    type: String,
    default: '16',
    name: '柱子标签字体',
    filedType: 'string'
  },

  useTooltipFun: {
    type: Boolean,
    default: true,
    name: '启用tooltip函数',
    filedType: 'switch'
  },
  funcTooltip: {
    type: Function,
    default: 'function (params) {if (params instanceof Array) {let toolvalue = params[0].name;let pcanshu=["人","个","%"]; for (let i =0;i<=params.length -1;i++) {toolvalue += "<br />" + params[i].marker + params[i].seriesName + ": " + params[i].value[i + 1]+ pcanshu[i]} return toolvalue} }',
    name: 'tooltip触发函数',
    filedType: 'function'
  },

  ...nodata
}
